Skip to content

[Hotfix] ConvictionScore, FearIndex 결과 없을 때 에러 대신 기본값으로 변경#225

Merged
yjhss merged 2 commits intodevelopfrom
feat/analysis-109-score-api
Feb 19, 2026
Merged

[Hotfix] ConvictionScore, FearIndex 결과 없을 때 에러 대신 기본값으로 변경#225
yjhss merged 2 commits intodevelopfrom
feat/analysis-109-score-api

Conversation

@yjhss
Copy link
Contributor

@yjhss yjhss commented Feb 19, 2026

🔗 관련 이슈

관련된 이슈 번호를 적어주세요.

closes #

📌 작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요.

기존에는 하락장공포지수, 매수확신도 DB에 저장된 산출 결과값이 없을 경우 에러를 발생시켰지만, 두 지수 모두 산출에 일정 기간이 소요되므로 에러 대신 기본값 내려주는 것으로 변경하였습니다.

🧪 테스트 결과

Postman 스크린샷, 테스트 통과 여부 등을 첨부해주세요.

image image

📸 스크린샷 (선택)

필요시 스크린샷을 첨부해주세요.

📎 참고 사항 (선택)

리뷰어에게 전달할 내용이 있다면 작성해주세요.

Summary by CodeRabbit

릴리스 노트

  • 버그 수정
    • 신념 점수가 없을 때 더 이상 오류를 발생시키지 않고 기본값을 반환하도록 개선했습니다.
    • 공포 지수 데이터가 없을 때 더 이상 오류를 발생시키지 않고 기본값을 반환하도록 개선했습니다.
    • 관련 응답 처리 로직을 안정화하여 조회 시 일관된 결과를 제공하도록 했습니다.

@yjhss yjhss self-assigned this Feb 19, 2026
@yjhss yjhss added ♻️Refactor 리팩토링 🚨Hotfix 비상 비상 비상! labels Feb 19, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

두 서비스의 조회 로직이 데이터 부재 시 예외를 던지던 방식에서 기본 응답 객체를 반환하는 방식으로 변경되었습니다. 또한 ConvictionScoreServiceImpl 클래스에 @Transactional(readOnly = true) 애노테이션이 추가되었습니다.

Changes

Cohort / File(s) Summary
예외 처리 → 기본값 반환
src/main/java/com/umc/finly/domain/analysis/association/service/ConvictionScoreServiceImpl.java, src/main/java/com/umc/finly/domain/analysis/association/service/FearIndexServiceImpl.java
조회 결과가 없을 때 각각 예외를 던지던 로직을 기본 DTO 반환으로 변경. Conviction: convictionScore=0, status=LOW, placeholder phrase. FearIndex: fearIndex=0, changeDirection=SAME, changeValue=0, "collecting data" 문구.
트랜잭션 애노테이션 추가
src/main/java/com/umc/finly/domain/analysis/association/service/ConvictionScoreServiceImpl.java
클래스 레벨에 @Transactional(readOnly = true) 애노테이션이 추가됨.

Suggested labels

🚨Hotfix

Suggested reviewers

  • dosp74
  • wonee1
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경 사항을 명확하게 설명합니다. '[Hotfix] ConvictionScore, FearIndex 결과 없을 때 에러 대신 기본값으로 변경'은 두 지수가 결과 없을 때 에러 대신 기본값을 반환하도록 변경했다는 핵심 내용을 간결하고 구체적으로 전달합니다.
Description check ✅ Passed PR 설명이 템플릿의 필수 섹션을 충실히 작성했습니다. 작업 내용을 명확히 설명하고 Postman 스크린샷 2개를 통해 테스트 결과를 제시했으며, 두 API 모두 HTTP 200으로 정상 응답함을 보여줍니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/analysis-109-score-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/java/com/umc/finly/domain/analysis/association/service/ConvictionScoreServiceImpl.java (1)

30-43: @Transactional(readOnly = true) 누락으로 인한 일관성 문제

FearIndexServiceImpl은 클래스 레벨에 @Transactional(readOnly = true)가 선언되어 있어 읽기 전용 쿼리에 대한 DB 최적화 힌트를 제공합니다. 반면 ConvictionScoreServiceImpl에는 클래스 레벨 트랜잭션 어노테이션이 없고, getConvictionScore 메서드에도 별도 어노테이션이 없어 일관성이 부족합니다.

♻️ 클래스 레벨에 readOnly 트랜잭션 추가 제안
 `@Service`
 `@RequiredArgsConstructor`
+@Transactional(readOnly = true)
 public class ConvictionScoreServiceImpl implements ConvictionScoreService {

@yjhss yjhss merged commit 488dee7 into develop Feb 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚨Hotfix 비상 비상 비상! ♻️Refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants